package com.meida.module.system.provider.controller;

import com.meida.common.mybatis.model.*;
import com.meida.common.springmvc.base.BaseController;
import com.meida.module.system.client.entity.SysKeyword;
import com.meida.module.system.provider.service.SysKeywordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;


/**
 * 关键词控制器
 *
 * @author flyme
 * @date 2019-07-06
 */
@RestController
@RequestMapping("/system/keyword/")
@Api(tags = "关键词管理")
public class SysKeywordController extends BaseController<SysKeywordService, SysKeyword> {

    @ApiOperation(value = "关键词-分页列表", notes = "关键词分页列表 ")
    @GetMapping(value = "pageList")
    @ApiIgnore
    public ResultBody pageList(@ModelAttribute(value = "pageModel") PageModel pageModel) {
        return bizService.pageList(pageModel);
    }

    @ApiOperation(value = "关键词-列表", notes = "关键词列表 ")
    @GetMapping(value = "list")
    public ResultBody list(@ModelAttribute(value = "model") ListModel model) {
        return bizService.listEntityMap(model);
    }

    @ApiOperation(value = "关键词-添加", notes = "添加关键词")
    @PostMapping(value = "add")
    @ApiIgnore
    public ResultBody add(SaveModel model) {
        return bizService.add(model);
    }

    @ApiOperation(value = "关键词-更新", notes = "更新关键词")
    @PostMapping(value = "update")
    @ApiIgnore
    public ResultBody update(UpdateModel model) {
        return bizService.edit(model);
    }

    @ApiOperation(value = "关键词-删除", notes = "删除关键词")
    @PostMapping(value = "delete")
    @ApiIgnore
    public ResultBody delete(DeleteModel model) {
        return bizService.delete(model);
    }


}
